﻿using Furion.DependencyInjection;
using Mapster;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Mapster;
using MapsterMapper;
using furion.blog.Domain.Shared.Dto.TagConfig;
using furion.blog.Domain.MySQL;

namespace furion.blog.Application.CustomMapper
{
    public class TagConfigMapper : Mapper, IRegister, ISingleton
    {
        public void Register(TypeAdapterConfig config)
        {
            //dto 转 po
            config.ForType<TagConfigUpdateDto, TagConfig>()
                .Map(dest => dest.TagLabel, source => source.TagLabel)
                .Map(dest => dest.TagKey, source => source.TagKey)
                .Map(dest => dest.GroupKey, source => source.GroupKey)
                .Map(dest => dest.Status, source => source.Status)
                .Map(dest => dest.UpdatedBy, source => source.UpdatedBy)
                .Map(dest => dest.UpdatedTime, source => source.UpdatedTime)
                .Map(dest => dest.Icon,source => source.Icon)
                .IgnoreNonMapped(true);
        }
    }
}
